home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Treccani Italiana Di Scienze Lettere Ed Arti
/
[Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso
/
pc
/
data
/
xxi_appendice_dvd.swf
/
scripts
/
__Packages
/
CAlert.as
next >
Wrap
Text File
|
2007-11-08
|
5KB
|
153 lines
class CAlert extends mx.core.UIObject
{
var mAutoHide = true;
function CAlert()
{
super();
this.mOkCallback = null;
this.mYesCallback = null;
this.mNoCallback = null;
this.mCancelCallback = null;
this.mCssInitDone = false;
this.Init();
}
function SetCallback(inButtonId, inCallerObj, inFunctionName, inArgArray)
{
if(inButtonId.toLowerCase() == "ok")
{
this.mOkCallback = {callerObject:inCallerObj,functionName:inFunctionName,argArray:inArgArray};
}
else if(inButtonId.toLowerCase() == "yes")
{
this.mYesCallback = {callerObject:inCallerObj,functionName:inFunctionName,argArray:inArgArray};
}
else if(inButtonId.toLowerCase() == "no")
{
this.mNoCallback = {callerObject:inCallerObj,functionName:inFunctionName,argArray:inArgArray};
}
else if(inButtonId.toLowerCase() == "cancel")
{
this.mCancelCallback = {callerObject:inCallerObj,functionName:inFunctionName,argArray:inArgArray};
}
}
function Init()
{
this._x = (Stage.width - this.mc_dialog_bkg._width) / 2;
this._y = (Stage.height - this.mc_dialog_bkg._height) / 2;
var _loc3_ = {x:0,y:0};
this.mc_grab_clip.globalToLocal(_loc3_);
this.mc_grab_clip._x = _loc3_.x;
this.mc_grab_clip._y = _loc3_.y;
this.mc_grab_clip._width = Stage.width;
this.mc_grab_clip._height = Stage.height;
this.mc_grab_clip.onPress = function()
{
};
this.mc_grab_clip.useHandCursor = false;
this.mc_grab_clip._alpha = 10;
this.txt_AlertTitle.html = true;
this.txt_AlertMessage.html = true;
this.txt_AlertTitle.wordWrap = true;
this.txt_AlertMessage.wordWrap = true;
this.txt_AlertTitle.embedFonts = _global.gUseEmbeddedFont;
this.txt_AlertMessage.embedFonts = _global.gUseEmbeddedFont;
this.Hide();
}
function InitCSS()
{
if(this.mCssInitDone == true)
{
return undefined;
}
this.mCssInitDone = true;
this.txt_AlertTitle.embedFonts = _global.gUseEmbeddedFont;
this.txt_AlertMessage.embedFonts = _global.gUseEmbeddedFont;
this.txt_AlertTitle.styleSheet = _global.gStyleManager.GetCSS();
this.txt_AlertMessage.styleSheet = _global.gStyleManager.GetCSS();
}
function ShowAlert(inTitle, inMessage, inFrameLabel, inBkgAlpha)
{
this.InitCSS();
var _loc2_ = inTitle;
if(_loc2_.length == 0)
{
_loc2_ = CAlert.DEFAULT_TITLE;
}
this.txt_AlertTitle.htmlText = "<span class=\'alertTitle\'>" + _loc2_ + "</span>";
this.txt_AlertMessage.htmlText = "<span class=\'alertTesto\'>" + inMessage + "</span>";
this.mc_grab_clip._alpha = inBkgAlpha;
this._visible = true;
this.gotoAndStop(inFrameLabel.toLowerCase());
}
function ShowAlertByMsgId(inMsgId, inFrameLabel, inBkgAlpha)
{
if(!this.mMessage)
{
return undefined;
}
this.InitCSS();
var _loc2_ = this.mMessage.GetMessage(inMsgId);
if(!_loc2_)
{
return undefined;
}
this.txt_AlertTitle.text = "<span class=\'alertTitle\'>" + _loc2_.title + "</span>";
this.txt_AlertMessage.text = "<span class=\'alertTesto\'>" + _loc2_.body + "</span>";
this.mc_grab_clip._alpha = inBkgAlpha;
this._visible = true;
this.gotoAndStop(inFrameLabel);
}
function Hide()
{
this._visible = false;
}
function YesBtnCallback()
{
if(this.mAutoHide == true)
{
this.Hide();
}
if(this.mYesCallback != null)
{
this.mYesCallback.callerObject[this.mYesCallback.functionName].apply(this.mYesCallback.callerObject,this.mYesCallback.argArray);
this.mYesCallback = null;
}
}
function NoBtnCallback()
{
if(this.mAutoHide == true)
{
this.Hide();
}
if(this.mNoCallback != null)
{
this.mNoCallback.callerObject[this.mNoCallback.functionName].apply(this.mNoCallback.callerObject,this.mNoCallback.argArray);
this.mNoCallback = null;
}
}
function CancelBtnCallback()
{
if(this.mAutoHide == true)
{
this.Hide();
}
if(this.mCancelCallback != null)
{
this.mCancelCallback.callerObject[this.mCancelCallback.functionName].apply(this.mCancelCallback.callerObject,this.mCancelCallback.argArray);
this.mCancelCallback = null;
}
}
function OkBtnCallback()
{
if(this.mAutoHide == true)
{
this.Hide();
}
if(this.mOkCallback != null)
{
this.mOkCallback.callerObject[this.mOkCallback.functionName].apply(this.mOkCallback.callerObject,this.mOkCallback.argArray);
this.mOkCallback = null;
}
}
}